package com.region.struts2;

import java.util.List;

import org.apache.struts2.json.annotations.JSON;

import com.opensymphony.xwork2.ActionSupport;
import com.region.entity.Region;
import com.region.service.IRegionService;

public class RegionAction extends ActionSupport{
	
	private static final long serialVersionUID = -763961462307042766L;
	
	private List<Region> regions;
	private IRegionService irs;
	private Integer parentId;
	
	public String getRegion() throws Exception {
		regions = irs.findByParentId(parentId);
		return SUCCESS;
	}
	
	public List<Region> getRegions() {
		return regions;
	}
	public void setRegions(List<Region> regions) {
		this.regions = regions;
	}
	
	@JSON(serialize=false)
	public IRegionService getIrs() {
		return irs;
	}
	public void setIrs(IRegionService irs) {
		this.irs = irs;
	}
	public Integer getParentId() {
		return parentId;
	}
	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}
}
